package com.isoft.pm01;

import java.util.Scanner;

public class EducationalSystem {
    String isContinue = "N";
    public void startRun() {
        do {
            SystemMenu.printLoginAndRegisterMenu();
            Scanner input = new Scanner(System.in);
            int userSelect = input.nextInt();
            switch (userSelect) {
                case 1 -> {
                    System.out.println("欢迎使用登录功能");
                }
                case 2 -> {
                    System.out.println("欢迎使用注册功能");
                }
                case 3 -> {
                    System.out.println("是否真的要退出本系统?(Y|N)");
                    String confirm = input.next();
                    if (confirm.equalsIgnoreCase("y")) {
                        System.exit(0);
                    }
                }
                default -> {
                    System.out.println("您的选择有误，请重试！");
                }
            }
            System.out.println("是否进行操作本系统？(Y|N)");
            isContinue = input.next();
        } while (isContinue.equalsIgnoreCase("y"));
        System.out.println("Bye!");
    }
}
